import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);

export default new Router({
    base: "/bmh5/",
    scrollBehavior(to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition
        } else {
            return { x: 0, y: 0 }
        }
    },
    routes: [{
            path: "/",
            name: "home",
            component: resolve => require(['./views/Home.vue'], resolve),
            meta: {
                title: '大件会建材直采'

            }
        },
        {
            path: "/jbc110",
            name: "jbc110",
            component: resolve => require(['./views/jbc.vue'], resolve),
            meta: {
                title: 'jbc110'
            }
        },
        {
            path: "/cityList",
            name: "cityList",
            component: resolve => require(['./views/cityList.vue'], resolve),
            meta: {
                title: '城市选择'
            }
        },
        {
            path: "/detail",
            name: "detail",
            component: resolve => require(['./views/detail/Detail.vue'], resolve),
            meta: {
                title: '采购团详情页'
            }
        },
        /*
         *
         * */
        {
            path: "/enrollRecord",
            name: "enrollRecord",
            component: resolve => require(['./views/enroll/EnrollRecord.vue'], resolve),
            meta: {
                title: '报名记录',
                isLogin: true
            },
        },
        {
            path: "/order",
            name: "order",
            component: resolve => require(['./views/order/Order.vue'], resolve),
            meta: {
                title: '我的订单',
                isLogin: true
            },
        },
        {
            path: "/mine",
            name: "mine",
            component: resolve => require(['./views/personal/Mine.vue'], resolve),
            meta: {
                title: '我的',
                isLogin: true
            },
        },
        /*
         *
         *
         * */
        {
            path: "/login",
            name: "login",
            component: resolve => require(['./views/login/Login.vue'], resolve),
            meta: {
                title: '快捷登录'
            }
        },
        {
            path: "/personalMaterial",
            name: "personalMaterial",
            component: resolve => require(['./views/personalMaterial/PersonalMaterial.vue'], resolve),
            meta: {
                title: '个人资料',
                isLogin: true
            }
        },
    ]
});